{{define "content"}}
<div class="row justify-content-center">
    <div class="col-md-8">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h4 class="mb-0">
                    <i class="fas fa-eye me-2"></i>
                    模型配置详情 #{{.Config.ID}}
                </h4>
                <div>
                    <a href="/admin/edit/{{.Config.ID}}" class="btn btn-primary btn-sm">
                        <i class="fas fa-edit me-1"></i>编辑
                    </a>
                    <a href="/admin" class="btn btn-secondary btn-sm">
                        <i class="fas fa-arrow-left me-1"></i>返回
                    </a>
                </div>
            </div>
            <div class="card-body">
                <div class="row mb-4">
                    <div class="col-md-6">
                        <h6 class="text-muted mb-2">供应商信息</h6>
                        <div class="d-flex align-items-center mb-3">
                            {{if .Config.VendorImg}}
                            <img src="{{.Config.VendorImg}}" alt="{{.Config.VendorCN}}" class="vendor-logo me-3" width="48" height="48">
                            {{else}}
                            <div class="vendor-placeholder me-3">
                                <i class="fas fa-cube fa-2x text-muted"></i>
                            </div>
                            {{end}}
                            <div>
                                <h5 class="mb-1">{{.Config.VendorCN}}</h5>
                                <small class="text-muted">{{.Config.VendorEN}}</small>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <h6 class="text-muted mb-2">状态</h6>
                        {{if eq .Config.Enabled 1}}
                            <span class="badge bg-success fs-6">
                                <i class="fas fa-check-circle me-1"></i>启用中
                            </span>
                        {{else}}
                            <span class="badge bg-danger fs-6">
                                <i class="fas fa-times-circle me-1"></i>已禁用
                            </span>
                        {{end}}
                    </div>
                </div>

                <hr>

                <div class="row mb-4">
                    <div class="col-md-6">
                        <h6 class="text-muted mb-2">模型名称</h6>
                        {{if .Config.ModelName}}
                            <p class="mb-0">{{.Config.ModelName}}</p>
                        {{else}}
                            <p class="mb-0 text-muted">未设置</p>
                        {{end}}
                    </div>
                    <div class="col-md-6">
                        <h6 class="text-muted mb-2">模型类型</h6>
                        {{if eq .Config.ModelType "llm"}}
                            <span class="badge bg-primary fs-6">LLM (大语言模型)</span>
                        {{else if eq .Config.ModelType "embedding"}}
                            <span class="badge bg-success fs-6">Embedding (嵌入模型)</span>
                        {{else if eq .Config.ModelType "reranker"}}
                            <span class="badge bg-warning fs-6">Reranker (重排序模型)</span>
                        {{else}}
                            <span class="badge bg-secondary fs-6">{{.Config.ModelType}}</span>
                        {{end}}
                    </div>
                </div>

                <div class="mb-4">
                    <h6 class="text-muted mb-2">模型路径</h6>
                    <div class="bg-light p-3 rounded">
                        <code>{{.Config.ModelPath}}</code>
                    </div>
                </div>

                {{if .Config.RequestHeaders}}
                <div class="mb-4">
                    <h6 class="text-muted mb-2">请求头信息</h6>
                    <div class="bg-light p-3 rounded">
                        <pre class="mb-0"><code>{{.Config.RequestHeaders}}</code></pre>
                    </div>
                </div>
                {{end}}

                <div class="row">
                    <div class="col-md-6">
                        <h6 class="text-muted mb-2">创建时间</h6>
                        <p class="mb-0">{{.Config.CreatedAt.Format "2006-01-02 15:04:05"}}</p>
                    </div>
                    <div class="col-md-6">
                        <h6 class="text-muted mb-2">更新时间</h6>
                        <p class="mb-0">{{.Config.UpdatedAt.Format "2006-01-02 15:04:05"}}</p>
                    </div>
                </div>

                <hr class="mt-4">

                <div class="d-flex justify-content-between">
                    <a href="/admin" class="btn btn-secondary">
                        <i class="fas fa-arrow-left me-1"></i>返回列表
                    </a>
                    <div>
                        <button type="button" class="btn btn-outline-warning me-2" onclick="toggleStatus({{.Config.ID}})">
                            <i class="fas fa-power-off me-1"></i>
                            {{if eq .Config.Enabled 1}}禁用{{else}}启用{{end}}
                        </button>
                        <a href="/admin/edit/{{.Config.ID}}" class="btn btn-primary">
                            <i class="fas fa-edit me-1"></i>编辑
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{{end}}
